package com.ccrfid.rmc6.service.asset;

import com.ccrfid.rmc6.appconfig.exception.pojo.AppException;
import com.ccrfid.rmc6.entity.asset.AssetEntity;
import com.ccrfid.rmc6.entity.asset.AssetMoveEntity;
import com.ccrfid.rmc6.entity.asset.AssetView;
import com.ccrfid.rmc6.lbservice3.pojo.msg.MsgLocate;
import com.ccrfid.rmc6.pojo.dto.AssetMoveInLocationDto;
import com.ccrfid.rmc6.pojo.dto.LocatorAssetCount;
import com.ccrfid.rmc6.repository.search.SearchCriteria;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

import java.sql.Timestamp;
import java.util.List;

public interface AssetService {
    AssetEntity getAssetById(Long assetId);

    AssetEntity getAssetByCardNumber(Long cardNumber);

    AssetMoveEntity recordAssetMove(Long assetId, MsgLocate msgLocate);

    Page<AssetEntity> getAssetsInfoPage(SearchCriteria criteria, Pageable pageable);

    AssetEntity createAsset(AssetEntity entity) throws AppException;

    AssetEntity updateAsset(Long assetId, AssetEntity entity) throws AppException;

    Boolean deleteAssets(List<Long> idList) throws AppException;

    Boolean bindAssetCard(Long assetId, Long cardNumber) throws AppException;

    Boolean unBindAssetCard(Long assetId, Long cardNumber) throws AppException;

    List<AssetView> getAssetInfoListByLocatorAddressIsNotNull();

    List<AssetView> getAssetInfoListByLocatorAddress(Integer locatorAddress);

    List<LocatorAssetCount> getAssetDistribution(Integer floorNumber);

    List<AssetMoveInLocationDto> getAssetMoveLocationList(Long assetId, Timestamp startTime, Timestamp endTime);
}
